<div class="btn-group" style="margin-right:10px ;" av-if="!applicationCheckZhongrunhuizhan()">
	<button av-event="[click] eventQuery(:node,:event,'property', false)" class="btn btn-default" av-class="{'active':( typeof property == 'undefined' )}">全部类型</button>
	<button av-event="[click] eventQuery(:node,:event,'property', 0)" class="btn btn-default" av-class="{'active':( property == 0)}">普通商品</button>
	<button av-event="[click] eventQuery(:node,:event,'property', 1)" class="btn btn-default" av-class="{'active':( property == 1)}">积分商品</button>
</div>

<div class="btn-group" style="margin-right:10px ;">
	<button av-event="[click] eventQuery(:node,:event,'state', false)" class="btn btn-default" av-class="{'active':( typeof state == 'undefined' )}">全部状态</button>
	<button av-event="[click] eventQuery(:node,:event,'state', 3)" class="btn btn-default" av-class="{'active':( state == 3 )}">停售编辑中</button>
	<button av-event="[click] eventQuery(:node,:event,'state', 2)" class="btn btn-default" av-class="{'active':( state == 2 )}">等待审核</button>
	<button av-event="[click] eventQuery(:node,:event,'state', 1)" class="btn btn-default" av-class="{'active':( state == 1 )}">售卖中</button>
	<button av-event="[click] eventQuery(:node,:event,'state', 0)" class="btn btn-default" av-class="{'active':( state == 0 )}">审核失败</button>
</div>

<div class="btn-group" style="margin-right:10px ;" av-if="!applicationCheckZhongrunhuizhan()">
	<button av-event="[click] eventQuery(:node,:event,'when', false)" class="btn btn-default" av-class="{'active':( typeof when == 'undefined' )}">全部时效</button>
	<button av-event="[click] eventQuery(:node,:event,'when', 1)" class="btn btn-default" av-class="{'active':( when == 1 )}">限时</button>
	<button av-event="[click] eventQuery(:node,:event,'when', 0)" class="btn btn-default" av-class="{'active':( when == 0 )}">非限时</button>
</div>

<!--<a href="#/shop/goods_add" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> 添加</a>-->
<button class="btn btn-default" type="button" action-button="sort" av-event="[click] eventGoodsSort(:node,:event)"><span class="glyphicon glyphicon-sort"></span> 排序</button>
<button class="btn btn-default" av-event="[click] eventSellState(:node,:event,1)" type="button" style="margin-left: 5px;"><span class="glyphicon glyphicon-ok-circle"></span> 售卖</button>
<button class="btn btn-default" av-event="[click] eventSellState(:node,:event,3)" type="button" style="margin-left: 5px;"><span class="glyphicon glyphicon-ban-circle"></span> 停售</button>
<button class="btn btn-danger" av-event="[click] eventRemove(:node,:event)" type="button" style="margin-left: 5px;"><span class="glyphicon glyphicon-trash"></span> 回收</button>
<button class="btn btn-default" av-event="[click] eventSearch(:node,:event)" type="button" style="margin-left: 5px;"><span class="glyphicon glyphicon-filter"></span> 筛选</button>

<button class="btn btn-default" av-if="applicationCheckXiLeTao()" av-event="[click] eventImportGoods()" type="button" style="margin-left: 10px;"><span class="glyphicon glyphicon-import"></span> 导入商品</button>
<span av-if="checkRouterAnchorQuerySearch()" class="label label-default" style="margin-left: 5px;">存在筛选</span>

<hr/>
<table class="table table-striped">
	<thead>
		<tr>
			<th style="width: 2%;"><input type="checkbox" checkbox="checkbox-all"></th>
			<th style="width: 3%;">#</th>
			<th style="width: 23%;">
				商品ID/<a href="javascript:;" av-event="[click] eventSort(:node,:event,'name_asc', 'name_desc')"><span av-if="existSort('name_asc', 'name_desc')" class="glyphicon" av-class="{'glyphicon glyphicon-sort-by-attributes':checkSort('name_asc'), 'glyphicon-sort-by-attributes-alt':checkSort('name_desc')}"></span>商品名称</a>
			</th>
			<th style="width: 5%;">
				<a href="javascript:;" av-event="[click] eventSort(:node,:event,'state_asc', 'state_desc')">
					<span av-if="existSort('state_asc', 'state_desc')" class="glyphicon" av-class="{'glyphicon glyphicon-sort-by-attributes':checkSort('state_asc'), 'glyphicon-sort-by-attributes-alt':checkSort('state_desc')}">					
					</span>状态
				</a>
			</th>
			<th style="width: 10%;">
				<a href="javascript:;" av-event="[click] eventSort(:node,:event,'min_price_asc', 'min_price_desc')"><span av-if="existSort('min_price_asc', 'min_price_desc')" class="glyphicon" av-class="{'glyphicon glyphicon-sort-by-attributes':checkSort('min_price_asc'), 'glyphicon-sort-by-attributes-alt':checkSort('min_price_desc')}"></span>最底单价</a>
				~
				<a href="javascript:;" av-event="[click] eventSort(:node,:event,'max_price_asc', 'max_price_desc')"><span av-if="existSort('max_price_asc', 'max_price_desc')" class="glyphicon" av-class="{'glyphicon glyphicon-sort-by-attributes':checkSort('max_price_desc'), 'glyphicon-sort-by-attributes-alt':checkSort('max_price_asc')}"></span>最高单价</a>
			</th>
			<th style="width: 8%;">
				<a href="javascript:;" av-event="[click] eventSort(:node,:event,'stock_sum_asc', 'stock_sum_desc')">
					<span av-if="existSort('stock_sum_asc', 'stock_sum_desc')" class="glyphicon" av-class="{'glyphicon glyphicon-sort-by-attributes':checkSort('stock_sum_asc'), 'glyphicon-sort-by-attributes-alt':checkSort('stock_sum_desc')}">					
					</span>库存
				</a>/销量
			</th>
			<th style="width: 8%;">
				<a href="javascript:;" av-event="[click] eventSort(:node,:event,'stock_sum_asc', 'stock_sum_desc')">
					<span av-if="existSort('stock_sum_asc', 'stock_sum_desc')" class="glyphicon" av-class="{'glyphicon glyphicon-sort-by-attributes':checkSort('stock_sum_asc'), 'glyphicon-sort-by-attributes-alt':checkSort('stock_sum_desc')}">					
					</span>减库存方式
				</a>
			</th>

			<th style="width: 10%;">
				<a href="javascript:;" av-event="[click] eventSort(:node,:event,'sort_asc', 'sort_desc')">
					<span av-if="existSort('sort_asc', 'sort_desc')" class="glyphicon" av-class="{'glyphicon glyphicon-sort-by-attributes':checkSort('sort_asc'), 'glyphicon-sort-by-attributes-alt':checkSort('sort_desc')}">					
					</span>排序
				</a>
			</th>
			<th style="width: 12%;">
				<a href="javascript:;" av-event="[click] eventSort(:node,:event,'update_time_asc', 'update_time_desc')">
					<span av-if="existSort('update_time_asc', 'update_time_desc')" class="glyphicon" av-class="{'glyphicon glyphicon-sort-by-attributes':checkSort('update_time_asc'), 'glyphicon-sort-by-attributes-alt':checkSort('update_time_desc')}">					
					</span>更新时间
				</a>
			</th>
			<th style="width: 10%;">操作</th>
		</tr>
	</thead>
	<tbody>
		<tr av-if="list && list.data && list.data.length" av-for="(value, key) list.data" av-event="[dblclick] eventTrDblclick(:node,:event)" av-attr="[data-id] value.shop_goods_id" data-checkbox="checkbox">
			<th><input type="checkbox" checkbox="checkbox" av-attr="[data-id] value.shop_goods_id"></th>
			<td>
				{{parseInt(key)+1+((parseInt(list.page_now) - 1) * list.page_size)}}
			</td>
			<td>
				<div style="color: #999;">ID：{{value.shop_goods_id}} </div>
				<div>
					<span av-is="value.shop_goods_property==1" class="label label-primary" style="margin-right: 5px;">积分商品</span>
					<a av-is="value.shop_goods_when" av-attr="[href] av.router(av.router().url,'default.html#/shop-goodsWhenList/?search=%257B%2522shop_goods_id%2522%253A%2522'+value.shop_goods_id+'%2522%257D').href" class="btn btn-default btn-xs" style="margin-right: 5px;">限时商品</a>
					<span style="color: #07141E;">商品名字：{{value.shop_goods_name}} </span>
				</div>
				<div style="color: #549fbd;">
				{{value.shop_goods_info}}
				</div>
			</td>
			
			<td>
				<!--if{parseInt(response.list.data[i].shop_goods_state) == 0}-->
				<span av-is="value.shop_goods_state==0" class="label label-danger">审核失败</span>
				<!--elseif{parseInt(response.list.data[i].shop_goods_state) == 1}-->
				<span av-is="value.shop_goods_state==1" class="label label-success">售卖中</span>
				<!--elseif{parseInt(response.list.data[i].shop_goods_state) == 2}-->
				<span av-is="value.shop_goods_state==2" class="label label-warning">等待审核</span>
				<!--elseif{parseInt(response.list.data[i].shop_goods_state) == 3}-->
				<span av-is="value.shop_goods_state==3" class="label label-info">停售编辑中</span>
				<!--/if-->
			</td>

			<td>
				<span av-if='value.shop_goods_stock_sum == 0' style="color: #999;">无库存即没价格</span>
				<span av-else-if='value.shop_goods_stock_sum != 0 && value.shop_goods_property==1'> 
					{{(value.shop_goods_min_price/100).toFixed(2)}}积分
					<span av-if="applicationCheckEmshop() && value.shop_goods_sku_min!='' && value.shop_goods_sku_min.shop_goods_sku_additional_money!=0">
						附加{{(value.shop_goods_sku_min.shop_goods_sku_additional_money/100).toFixed(2)}}人民币
					</span> 
					~ {{(value.shop_goods_max_price/100).toFixed(2)}}积分
					<span av-if="applicationCheckEmshop() && value.shop_goods_sku_max!='' && value.shop_goods_sku_max.shop_goods_sku_additional_money!=0">
							附加{{(value.shop_goods_sku_max.shop_goods_sku_additional_money/100).toFixed(2)}}人民币
						</span> 
				</span>
				<span av-else-if='value.shop_goods_stock_sum != 0 && value.shop_goods_property==0'> 
					{{(value.shop_goods_min_price/100).toFixed(2)}}元 
					<span av-if="applicationCheckEmshop() && value.shop_goods_sku_min!='' && value.shop_goods_sku_min.shop_goods_sku_additional_credit!=0">
							附加{{parseFloat(value.shop_goods_sku_min.shop_goods_sku_additional_credit/applicationCreditConfig().scale).toFixed(applicationCreditConfig().precision)}}积分
						</span> 
					~ {{(value.shop_goods_max_price/100).toFixed(2)}}元
					<span av-if="applicationCheckEmshop() && value.shop_goods_sku_max!='' && value.shop_goods_sku_max.shop_goods_sku_additional_credit!=0">
							附加{{parseFloat(value.shop_goods_sku_max.shop_goods_sku_additional_credit/applicationCreditConfig().scale).toFixed(applicationCreditConfig().precision)}}积分
						</span> 
				</span>
			</td>

			<td>
				<span av-if='value.shop_goods_stock_sum == null' style="color: #999;">无规格</span>
				<span av-else style="color:#0F0F0F;">{{value.shop_goods_stock_sum}}</span>
				/{{value.shop_goods_sales}}
			</td>
			<td>

				<!--if{parseInt(response.list.data[i].shop_goods_stock_mode) == 0}-->
				<span av-is='value.shop_goods_stock_mode ==0' class="label label-default">始终不减库存</span>
				<!--elseif{parseInt(response.list.data[i].shop_goods_stock_mode) == 1}-->
				<span av-is='value.shop_goods_stock_mode == 1' class="label label-default">下单预扣库存</span>
				<span av-is='value.shop_goods_stock_mode == 2' class="label label-default">付款减库存</span>
				<span av-is='value.shop_goods_stock_mode == 3' class="label label-default">发货减库存</span>

			</td>
			<td><input type="text" class="form-control" placeholder="排序" input="sort" av-attr="[data-id] value.shop_goods_id" av-attr="[value] value.shop_goods_sort" style="max-width: 100px;"></td>
			<td>
				{{av.date("yyyy/MM/dd HH:mm EEE", parseInt(value.shop_goods_update_time) * 1000)}}
			</td>
			<td>
				<a av-attr="[href] '#/shop-goodsEdit?id='+value.shop_goods_id" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-edit"></span>编辑</a>
				 <a av-attr="[href] '#/shop-goodsAttr?sort=update_time_desc&id='+value.shop_goods_id" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-edit"></span>规格</a>
				<!--<button class="btn btn-default" av-if="applicationCheckXiLeTao()" av-event="[click] eventImportGoodsDetail(value.shop_goods_id)" type="button" style="margin-left: 10px;"><span class="glyphicon glyphicon-import"></span> 导入商品详情</button> -->
				<a av-if="applicationCheckYitaoshop()" av-attr="[href] '#/yitao-stockRecordList?sort=update_time_desc&id='+value.shop_goods_id" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-list-alt"></span>库存扣除明细</a>
				<a av-is="applicationCheckChuanglianzhongyi()" av-attr="[href] av.router(av.router().url,'default.html#/shop-goodsRegionList/?sort=update_time_desc&search=%257B%2522shop_goods_id%2522%253A%2522'+value.shop_goods_id+'%2522%257D').href" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-edit"></span>售卖地区</a>
			</td>

		</tr>
		<tr av-else>
			<td colspan="15" align="center">无数据</td>
		</tr>
	</tbody>
</table>

<!--if{response.list.data.length}-->
<div av-if="list.data.length" style="text-align: center;">
	<button class="btn btn-default" data-page="1" av-class="{'disabled':isFirstPage(list.page_now)}" type="button" style="margin-right: 5px;" av-event="[click] eventPageRequest(:node,:event)">首页</button>
	<button class="btn btn-default" av-attr="[data-page] parseInt(list.page_now) - 1" av-class="{'disabled':isFirstPage(list.page_now)}" type="button" style="margin-right: 5px;" av-event="[click] eventPageRequest(:node,:event)">上一页</button>
	<button class="btn btn-default" type="button" style="margin-right: 5px;">
		第{{list.page_now}}页
		/ 共{{list.page_count}}页
		/ 有{{list.row_count}}条数据</button>
	<button class="btn btn-default" type="button" av-attr="[data-page] parseInt(list.page_now) + 1" av-class="{'disabled':isEndPage(list.page_now, list.page_count)}" style="margin-right: 5px;" av-event="[click] eventPageRequest(:node,:event)">下一页</button>
	<button class="btn btn-default" type="button" av-attr="[data-page] list.page_count" av-class="{'disabled':isEndPage(list.page_now, list.page_count)}" style="margin-right: 5px;" av-event="[click] eventPageRequest(:node,:event)">尾页</button>
</div>
<!--/if-->

